package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.WxBean;
import com.lwj.liwanjia.impl.WxView;
import com.lwj.liwanjia.model.ChongzhiWxPayModel;
import com.lwj.liwanjia.model.IndentWxPayModel;

import java.util.Map;

import rx.Subscriber;

/**
 * Created by Administrator on 2017/11/15.
 */

public class ChongzhiWxPayPresenter {
    private WxView wxView;
    private ChongzhiWxPayModel chongzhiWxPayModel;

    public ChongzhiWxPayPresenter(WxView wxView) {
        this.wxView = wxView;
        chongzhiWxPayModel=new ChongzhiWxPayModel();
    }

    public void getChongzhiPayInfo(String token,String money) {
        if (wxView != null) {
            chongzhiWxPayModel.getChongzhiPayInfo(token,money, new Subscriber<WxBean>() {
                @Override
                public void onCompleted() {

                }

                @Override
                public void onError(Throwable e) {
                    wxView.showError((Exception) e);
                }

                @Override
                public void onNext(WxBean wxBean) {
                    wxView.getWxPayInfo(wxBean);
                }
            });
        }
    }
}
